﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DBModel
{
    public partial class User
    {
        public override string ToString()
        {
            return UserName;
        }
    }

    public class UserDB
    {
        public static User AuthenticateUser(string userName, string password)
        {
            try
            {
                return DB.Context.Users.SingleOrDefault(u => u.UserName == userName && u.Password == password);
            }
            catch
            {
                return null;
            }
        }
    }
}
